fast on-demand c++ compilation [closed]
Posted
by
Amit Prakash
on Stack Overflow
See other posts from Stack Overflow
or by Amit Prakash
Published on 2012-09-24T07:03:33Z
Indexed on
2012/09/24
15:37 UTC
Read the original article
Hit count: 208
I'm looking at the possibility of building a system where when a query hits the server, we turn the query into c++ code, compile it as shared object and the run the code.
The time for compilation itself needs to be small for it to be worthwhile. My code can generate the corresponding c++ code but if I have to write it out on disk and then invoke gcc to get a .so file and then run it, it does not seem to be worth it.
Are there ways in which I can get a small snippet of code to compile and be ready as a share object fast (can have a significant start up time before the queries arrive). If such a tool has a permissive license thats a further plus.
Edit: I have a very restrictive query language that the users can use so the security threat is not relevant. My own code translates the query into c++ code. The answer mentioning clang is perfect.
© Stack Overflow or respective owner